package com.smh.a03ExercisesDemo1;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;

public class Test2 {
    public static void main(String[] args) {

        //70%的几率为男生,30%的几率为女生
        ArrayList<String> list = new ArrayList<>();
        Collections.addAll(list,"zhangsan","lisi","wangwu","maliu");
        ArrayList<String> list1 = new ArrayList<>();
        Collections.addAll(list1,"zhaoqi","zhouba");

        Random random = new Random();
        int index = random.nextInt(10);
        if (index<7){
            System.out.println(list.get(random.nextInt(list.size())));
        }else {
            System.out.println(list1.get(random.nextInt(list1.size())));
        }


    }
}
